#ifndef _CONFIG_H_
#define _CONFIG_H_

#include "String.h"
#include "SimpleIni.h"
#include <vector>

namespace serika
{
	namespace ut
	{
		class Config
		{
		public:
			Config(const Char* filePath);
			~Config();
		public:
			void GetAllKey(const Char* section, std::vector<ut::String>& keys);
			const Char* GetString(const Char* section, const Char* key, const Char* def = _T("")) const;
			int GetInt(const Char* section, const Char* key, int def = 0) const;
			bool GetBool(const Char* section, const Char* key, bool def = true) const;
			float GetFloat(const Char* section, const Char* key, float def = 0.0f) const;

			void SetString(const Char* section, const Char* key, const Char* value);
			void SetInt(const Char* section, const Char* key, int value);
			void SetBool(const Char* section, const Char* key, bool value);
			void SetFloat(const Char* section, const Char* key, float value);


			void Flush();
		protected:
			CSimpleIni m_ini;
			ut::String mFilePath;
			bool mModified;
		};
	}
}

#endif

